/**
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package snippet.theory5;

import java.util.ArrayList;

/**
 * List Array
 * @author hoang.pt
 */
public class ListDemo {

	/**
	 * main
	 * @author hoang.pt
	 * @param String a
	 */
    public static void main(String[] a) {

        //init array
        ArrayList<String> aList = new ArrayList<String>();

        //add element into array
        aList.add("This is Mai");
        aList.add("This is Hoang");
        aList.add("This is Thien");
        aList.add("This is Hung");
        aList.add("This is Viet");

        //get 1 element and print
        System.out.println(aList.get(0));

        String ab = "This is Hung";
        System.out.println(aList.contains(ab));

    }


}
